package cn.com.fig.control;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import cn.com.fig.common.PaginationReqParam;
import cn.com.fig.common.PaginationResponse;
import cn.com.fig.common.ReplyMsg;
import cn.com.fig.service.DepartmentService;

/**
 * Hello world!
 *
 */
@RestController
@RequestMapping("/department")
public class DepartmentControl {
	
	@Autowired
	private DepartmentService departmentService;
	
	@RequestMapping("/list")
	public PaginationResponse<Map<String,Object>> list(PaginationReqParam reqParam) {
		return departmentService.listDepartment(reqParam);
	}
	
	@RequestMapping("/save")
	public ReplyMsg save(@RequestParam Map<String,Object> tradeSys){
		return departmentService.save(tradeSys);
	}
	
	@RequestMapping("/del")
	public ReplyMsg del(String departId){
		return departmentService.del(departId);
	}
}
